<?php
/**
 * Created by PhpStorm.
 * User: yzapple
 * Date: 2018/1/17
 * Time: 上午8:56
 */

namespace app\admin\controller;

use think\Db;
use think\Request;

/**
 * 患者列表
 *
 */
class Patient extends Basecontroller
{

    /**
     * 患者列表
     */
    public function index()
    {
        //获取搜索出来的患者列表
        \think\Loader::action('doctor/Patient/index','event');
        $this->assign('breadcrumb', '患者列表');
        return $this->fetch();

    }



    /**
     * 患者信息
     */
    public function patient_info()
    {

        //获取搜索出来的患者列表
        \think\Loader::action('doctor/Patient/patient_info','event');
        $data = $this->request->param();
        $type = isset($data['type']) ? $data['type']:'';
        $this->assign('breadcrumb', '患者信息');
        $this->assign('type',$type);
        return $this->fetch();

    }


    /**
     * 新建患者
     */
    public function add_patient()
    {

        \think\Loader::action('doctor/Patient/add_patient','event');
        $this->assign('breadcrumb', '添加患者');
        return $this->fetch();
    }


    /**
     * 编辑患者
     */
    public function edit_patient()
    {

        //获取数据
        $data = $this->request->param();
        $id = $data['id'];
        $list =  $this->getPatient_ById($id);
        $this->assign('list', $list);
        $this->assign('breadcrumb', '编辑患者');
        return $this->fetch('add_patient');
    }

}